package com.design.testdemo.activity;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Toast;

import com.design.testdemo.R;
import com.design.testdemo.view.ATProgressView;
import com.design.testdemo.view.OptionCircle;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * @Auther: Timmy
 * @Data: 2017/6/17
 * @Fuction:
 */

public class CicleActivity extends AppCompatActivity {

    @BindView(R.id.progressview)
    ATProgressView mATProgressView;
    @BindView(R.id.cicle)
    OptionCircle mCicle;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_cicle);
        ButterKnife.bind(this);
        initProgressView();
    }

    private void initProgressView() {
        mATProgressView.setCountdownTime(10);
        mATProgressView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                mCicle.sopAnimation();

                mATProgressView.startCountdown(new ATProgressView.OnCountDownFinishListener() {
                    @Override
                    public void countDownFinished() {
                        Toast.makeText(CicleActivity.this, "倒计时结束了--->该UI处理界面逻辑了", Toast.LENGTH_LONG).show();
                    }
                });
            }
        });

        mCicle.setCircleVisible(true);

        mCicle.startCountdown();
    }
}
